<layout name='Layout/layout_main' />
<link type="text/css" href="__PUBLIC__/css/jquery-ui.css" rel="stylesheet"/>
<link type="text/css" href="__PUBLIC__/css/new_style.css" rel="stylesheet"/>
<script type="text/javascript" src="__PUBLIC__/js/jquery-ui.min.js"></script>
</style>
<tagLib name="html" />
	<script type="text/javascript">
		function save() {
			sendForm2("form_data", "{:U('save')}&__URL__");
		}
                function select_user(){
                   var m = $.ligerDialog.open({ height: 600, url:"{:U('user/select_dept')}", width: 700, showMax: true, showToggle: true, showMin: true, isResize: true, modal: false, title: '选择用户',buttons: [ { text: '取消', onclick: function (item, dialog) { dialog.close(); } } ] });
                }
                
                function select_customer(){
                    var n = $.ligerDialog.open({ height: 600, url:"{:U('Customer/select_customer')}", width: 700, showMax: true, showToggle: true, showMin: true, isResize: true, modal: false, title: '选择客户',buttons: [ { text: '取消', onclick: function (item, dialog) { dialog.close(); } } ] });
                }
                
                $(function(){
                     add_child();
                     $("#acceptance_date").datepicker({ altFormat: 'yyyy-mm-dd' });
                     
                });
                
                function add_child(){
                    var add_id = $("#add_id").val();
                    $('#parent_table').append('<tr align="center" class="chlid_tr"><td><input type="text"  name="customer_name[]" value=""/></td><td><input type="text" name="call_num[]" value=""/></td><td><input type="text" name="telecom_perators[]" value=""/></td><td><input type="text" name="recharge_amount[]" value=""/> 元</td><td><input type="text" name="annual_amount[]" onchange="auto_get_monthly_amout('+add_id+',this.value)" value=""/> 元</td><td><input type="text" name="monthly_amount[]" id="monthly_amount_'+add_id+'" value=""/> 元</td><td onclick="del_child(this)">删除</td></tr>');
                    $("#add_id").val(add_id+1);
                }
                
                function del_child(obj){
                    $(obj).parent().remove();
                }
                
                function auto_get_monthly_amout(id,value){
                    $('#monthly_amount_'+id).val(value/12);
                }
	</script>
   <div class="customer">
		<div class="row-fluid title"><span><nobr>万膳商城会员话费升值受理单</nobr></span></div>
			<form method='post' id="form_data">
			<input type="hidden" name="opmode" value="add">
			<input type="hidden" name="ajax" id="ajax" value="0">
                        <input type="hidden" name="customer_id" id="customer_id" value="" />
                        <input type="hidden" name="user_id" id="user_id" value="" />
                        <input type="hidden" name="dept_id" id="dept_id" value="" />
                        <input type="hidden" name="add_id" id="add_id" value="1" />
			<div class="row-fluid form_box">
				<div class="row-fluid form-horizontal">
					<div class="control-group span6">
						<label class="control-label" for="customer_name">客户名称</label>
						<div class="controls">
							<input type="text" id="customer_name" name="customer_name" readonly="readonly"> <input type="button" onclick="select_customer();" value="选择客户" name="btn_select_dept" class="btn"></div>
					</div>
                                    
                                    <div class="control-group span6">
						<label class="control-label" for="acceptance_date">受理日期</label>
						<div class="controls">
							 <input type="text" value="" readonly="readonly" name="acceptance_date" id="acceptance_date"  class="input-date" /></div>
					</div>

				</div>
				<div class="row-fluid form-horizontal">
                                        <div class="control-group span6">
						<label class="control-label" for="phone_num">联系号码</label>
						<div class="controls">
                                                    <input type="text" name="phone_num" id="phone_num" value="" />
                                                </div>
					</div>
					<div class="control-group span6">
						<label class="control-label" for="acceptance_address">受理地点</label>
						<div class="controls">
							<input type="text" value="" id="acceptance_address" name="acceptance_address">
                                                </div>
					</div>
                                </div>
                            <div class="row-fluid form-horizontal">
					<div class="control-group span6">
						<label class="control-label" for="authorized_representative">商城授权代表</label>
						<div class="controls">
							<input type="text" id="authorized_representative" name="authorized_representative" ></div>
					</div>
                                    <div class="control-group span6">
						<label class="control-label" for="payment">支付方式</label>
						<div class="controls">
                                                    <select name="payment" id="payment">
                                                        <option value="1">现金支付</option>
                                                        <option value="2">转账支付</option>
                                                        <option value="3">网络支付</option>
                                                        <option value="4">其他支付</option>
                                                    </select>
							
                                                </div>
					</div>
				</div>
                            
				<div class="row-fluid form-horizontal">
					<div class="control-group span6">
						<label class="control-label" for="salesman">业务员/代办人</label>
						<div class="controls">
							<input type="text" id="salesman" name="salesman" readonly="readonly"> <input type="button" onclick="select_user();" value="选择业务员" name="btn_select_dept" class="btn"></div>
					</div>
                                    
                                    
                                     <div class="control-group span6">
						<label class="control-label" for="business_type">业务类型</label>
						<div class="controls">
                                                    <input type="text" value="" name="business_type" id="business_type" />							
                                                </div>
					</div>
				</div>
 				<div class="row-fluid form-horizontal">
					<div class="control-group">
						<label class="control-label" for="childreen">受理资料明细：</label>
						<div class="controls">
                                                    <table width="100%"  id="parent_table">
                                                        <tr align="center">
                                                            <td width="8%">客户改名</td><td width="15%">电话号码</td><td width="10%">网络运营商</td><td width="15%">充值金额</td><td width="15%">年度可得额</td><td width="15%">每月可得额</td><td width="10%"><span onclick="add_child()">添加</span></td>
                                                        </tr>
                                                    </table>
					</div>
				</div>
                            


 				<div class="row-fluid form-horizontal">
					<div class="control-group">
						<label class="control-label" for="remark">其他：</label>
						<div class="controls">
							<textarea  name="remark" rows="5" class="span12"></textarea>
					</div>
				</div>
                                    
                                    
				<div class="action">
					<input class="btn default" type="button" value="保存" onclick="save();">
					<input  class="btn" type="button" value="取消" onclick="go_return_url();">		
				</div>
                         </form>
                        </div>